// pages/region/regionCenter/index.js
var basePage=require('../../../common/BasePage')
var baseList=require('../../../common/BaseList')
Page({
behaviors:[basePage,baseList],
    /**
     * 页面的初始数据
     */
    data: {
        userInfo:{},
        type:2,
        reqUrl: '/home/areaWarehouse/commission?type=2',
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.getUserInfo()
        this.req_items()
    },
    getUserInfo(){
        this.request({
            url: this.data.host + "/home/user/info"
        }, res => {
            // console.log("user/info",res.data);
            let userInfo = getApp().globalData.userInfo = res.data;
            res.data.thumb = this.get_thumb(res.data.face);
            this.setData({
                userInfo
            });
        });
    },
    toLink(e){
        let state = e.currentTarget.dataset.state;
        wx.navigateTo({
          url: '/pages/region/warehouseList/index?type='+state,
        })
    },
    changeType(e){
        let type = e.currentTarget.dataset.type;
        this.data.reqData.type = type
        this.setData({
            showSkeleton:true,
            type:type
        })
        this.data.current_page = 0;
        this.req_items()
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },
})